﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using NK.Domain.Entities;

namespace NK.Domain.Concrete
{
    public class EFDbInitializer: DropCreateDatabaseIfModelChanges<EFDbContext>
    {
        protected override void Seed(EFDbContext context)
        {
            var products = new List<Product>
                               {
                                   new Product {Name = "A", Price = 25},
                                   new Product {Name = "B", Price = 179}
                               };
            products.ForEach(s => context.Products.Add(s));
            context.SaveChanges();
        }
    }
}
